﻿#ifndef CVideoPlayer_H
#define CVideoPlayer_H
/********************************************************************************
** @ Date:2025/08/04
** @ Author: HanJiaXin
** @ Description:设备播放界面卡片
** @ Version:1.0.0
** @ ClassName:CVideoPlayer
** @ Fun:
********************************************************************************/

#include <QWidget>
#include <QTimer>
#include "ui_CVideoPlayer.h"
#include "CDevCamer.h"

class CVideoPlayer : public QWidget
{
	Q_OBJECT

public:
	CVideoPlayer(CDevCamer* pDev);
	~CVideoPlayer();

private:
	void initConnect();//初始化槽函数连接
	void setStyleSheetFile();//设置界面的样式表
	bool startPlayVideo();				                    //开始播放视频
	bool endPlayVideo();				                    //停止播放视频
	void videoSateClicked();

protected:
	bool eventFilter(QObject *watched, QEvent *event);

public slots:
	void slotPushPlay();//点击播放按钮槽函数
	void slotPushLarge();//点击弹窗播放按钮槽函数
	void slotPushSnop();//点击摄像头抓拍按钮槽函数
	void refreshData(bool bRefresh);     // 这个函数会被外部调用
	void slotRefreshUI();//刷新界面

private:
	Ui::CVideoPlayerClass ui;
	CDevCamer* m_pDev;
	bool m_bIsPlaying;					//当前是否在播放视频
	bool m_bRun;						//此界面当前是否在运行
	QTimer* m_pTimer;
	QString m_sNormalLamp;
	QString m_sWorkLamp;
	QString m_sAlarmLamp;
	QString m_sWarningLamp;
};
#endif